package com.zking.utils;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import com.zking.frame.LYK.JDBC;


public class TopGetFilmSrcDao {

	/**
	 * 通过传入电影名字，return 电影图片地址
	 * 
	 * */
	
	public static String getTopSrc(String film_name){
		String src = null;
		Connection conn= JDBC.getConn();
		
		String sql ="select film_imgSrc from film where film_name = ?";
		PreparedStatement pst=null;
		ResultSet rs=null;
		try {
			pst =conn.prepareStatement(sql);
			pst.setString(1, film_name);
			 rs=pst.executeQuery();
			while(rs.next()){
				src = rs.getString("film_imgSrc");
				
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		finally {
			ColseSql.colseAllsql(pst, rs, conn);
		}
		return src ;
	}
	public static void main(String[] args) {
		System.out.println(getTopSrc("叶问"));
	}
}
